Skip to content

1280 trip addition overhaul #1281

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Conversation

xsaschako
Copy link
Member

@xsaschako xsaschako commented May 16, 2025

Changes and Information

Please briefly list the changes (main added features, changed items, or corrected bugs) made:

  • Delete weekend trips
  • Change tests
  • Simplified and changed adding logic

If need be, add additional information and what the reviewer should look out for in particular:

  • Brunswick example will be deleted either way: ignore changes there

Merge Request - Guideline Checklist

Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.

Checks by code author

  • Every addressed issue is linked (use the "Closes #ISSUE" keyword below)
  • New code adheres to coding guidelines
  • No large data files have been added (files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • Tests are added for new functionality and a local test run was successful (with and without OpenMP)
  • Appropriate documentation for new functionality has been added (Doxygen in the code and Markdown files if necessary)
  • Proper attention to licenses, especially no new third-party software with conflicting license has been added
  • (For ABM development) Checked benchmark results and ran and posted a local test above from before and after development to ensure performance is monitored.

Checks by code reviewer(s)

  • Corresponding issue(s) is/are linked and addressed
  • Code is clean of development artifacts (no deactivated or commented code lines, no debugging printouts, etc.)
  • Appropriate unit tests have been added, CI passes, code coverage and performance is acceptable (did not decrease)
  • No large data files added in the whole history of commits(files should in sum not exceed 100 KB, avoid PDFs, Word docs, etc.)
  • On merge, add 2-5 lines with the changes (main added features, changed items, or corrected bugs) to the merge-commit-message. This can be taken from the briefly-list-the-changes above (best case) or the separate commit messages (worst case).

@xsaschako xsaschako linked an issue May 16, 2025 that may be closed by this pull request
2 tasks
@xsaschako xsaschako marked this pull request as ready for review May 16, 2025 16:19
@xsaschako xsaschako changed the title Refactor trip handling: simplify trip creation and remove weekend han… 1280 Refactor trip handling: simplify trip creation and remove weekend han… May 22, 2025
@xsaschako xsaschako requested a review from DavidKerkmann June 21, 2025 15:16
@xsaschako xsaschako changed the title 1280 Refactor trip handling: simplify trip creation and remove weekend han… 1280 trip addition overhaul Jun 21, 2025
@xsaschako xsaschako self-assigned this Jun 21, 2025
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.20%. Comparing base (b003e91) to head (b102d40).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1281      +/-   ##
==========================================
- Coverage   97.27%   97.20%   -0.08%     
==========================================
  Files         171      171              
  Lines       15117    15085      -32     
==========================================
- Hits        14705    14663      -42     
- Misses        412      422      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@DavidKerkmann DavidKerkmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the improvements. Some small questions remain.

@@ -125,8 +125,12 @@ class ABMMobilityEdge
for (int i = int(persons_to_change.size()) - 1; i >= 0; --i) {
auto& person = model_from.get_persons()[persons_to_change[i]];
auto target_type = person.get_location_type();
if (target_type == abm::LocationType::Count) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should this happen? Locations with LocationType::Count should be prohibited.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not in the graph abm. Please ask julia but in graph_abmmodel.h
person.set_location(abm::LocationType::Count, trip.destination, std::numeric_limits::max());
is set.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was discussed extensively. While in the current implementation nothing changes, it is worth noticing that the read-in of trips is now changed: Before, trips that change the model only considered the given LocationType and mapped this to an assigned location of the person. Now, the actual ID is required, which is then taken to determine the LocationType and then again being used to map to an assigned location.
This means that the location type of the ID is used, and people might go to another location (not the ID, but the assigned location of the same type).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a discussion we decided to use a LocationType::invalid, that is inserted after LocationType::Count.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trip addition overhaul
2 participants